use thiserror::Error;

/// Storage layer error types
#[derive(Error, Debug)]
pub enum StorageError {
    #[error("Key not found: {key}")]
    KeyNotFound { key: String },
    
    #[error("Type mismatch: expected {expected}, found {found}")]
    TypeMismatch { expected: String, found: String },
    
    #[error("Index out of bounds: {index}")]
    IndexOutOfBounds { index: i64 },
    
    #[error("Invalid argument: {message}")]
    InvalidArgument { message: String },
    
    #[error("Operation not supported: {operation}")]
    OperationNotSupported { operation: String },
    
    #[error("Internal error: {message}")]
    Internal { message: String },

    #[error("Invalid operation: {message}")]
    InvalidOperation { message: String },
}

/// Result type for storage operations
pub type Result<T> = std::result::Result<T, StorageError>;